# -*- coding: utf-8 -*-
'''
Created on 2013-6-1
技能
@author: 不懂d叛逆
'''
import ccjhObj
skillNameMap = {}
def FindSkillNameMap(skill):
	if skill in skillNameMap:
		return skillNameMap[skill]
	return ""

class ccjhSkill(ccjhObj.ccjhObj):
	def __init__(self, data = None):
		self.data = {}
		if data:
			self.setTo(data)
		self.enabled = False
		self.baseSkill = ""
		return

	def ToString(self):
		p = ""
		if self.enabled:
			p = "□"
		elif len(self.get("K")) > 0:
			p = "*)"
		else:
			p = "  "
		temp = "%s%s(%s)" % (p, self.get("N"), self.get("S"))
		return "%-30s%3s/%s" % (temp, self.get("L"), self.get("P"))

	def setTo16(self, obj):
		if isinstance(obj, ccjhSkill):
			self.data["N"] = obj.get("N")
			self.data["E"] = obj.get("E")
			self.data["s"] = obj.get("s")
		return
